Skip to content

Conversation

@sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Oct 16, 2025

This removes the special handling of exported immutable globals which simplifies the code in a few different ways.

For programs that export data addresses (this is relatively rare) this means codesize reduction for the generated JS (since it no longer contains the constant values) and the codesize increase for the Wasm binary (since it now contains extra exports).

The main reason for this is consistency with dynamic linking (where data exports are always needed) and a reduction in complexity.

Fixes: #25556

@sbc100 sbc100 requested a review from kripken October 16, 2025 14:33
@sbc100 sbc100 force-pushed the data_symbol_exports branch 2 times, most recently from 1808912 to d72fca6 Compare October 16, 2025 16:16
@sbc100 sbc100 force-pushed the data_symbol_exports branch 4 times, most recently from 6c1b746 to 2c3efc2 Compare October 18, 2025 21:18
@sbc100 sbc100 force-pushed the data_symbol_exports branch 6 times, most recently from 1eec49a to 6465935 Compare November 14, 2025 00:05
This removes the special handling of exported immutable globals which
simplifies the code in a few different ways.

For programs that export data addresses (this is relatively rare) this
means codesize reduction for the generated JS (since it no longer
contains the constant values) and the codesize increase for the Wasm
binary (since it now contains extra exports).

The main reason for this is consistency with dynamic linking (where data
exports are always needed) and a reduction in complexity.

Fixes: emscripten-core#25556
@sbc100 sbc100 force-pushed the data_symbol_exports branch from 6465935 to 154c718 Compare November 15, 2025 00:50
@sbc100 sbc100 enabled auto-merge (squash) November 15, 2025 01:33
@sbc100 sbc100 merged commit c7c65cc into emscripten-core:main Nov 15, 2025
34 checks passed
@sbc100 sbc100 deleted the data_symbol_exports branch November 15, 2025 01:37
sbc100 added a commit to sbc100/emscripten that referenced this pull request Nov 15, 2025
This was broken by emscripten-core#25568. This fixes the regression and updates an
existing test to catch it.
sbc100 added a commit to sbc100/emscripten that referenced this pull request Nov 15, 2025
This was broken by emscripten-core#25568. This fixes the regression and updates an
existing test to catch it.
sbc100 added a commit that referenced this pull request Nov 17, 2025
This was broken by #25568. This fixes the regression and updates an
existing test to catch it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wasm global exports don't work with DECLARE_ASM_MODULE_EXPORTS=0

2 participants